#ifndef TRADEVIEW_H
#define TRADEVIEW_H

#include <QObject>
#include <QTableView>
#include "buytradevaluesdialog.h"
#include "trade.h"
#include "stock/stock.h"

#define BUY_TRADE           0x03


class TradeView : public QObject
{
    Q_OBJECT
public:
    explicit TradeView(QObject *parent = 0);
    ~TradeView();

    void getBuyValues(const QString& stockName,Trade* tmpTrade);
    virtual void addTrade(Trade*,int flag)=0;

    void attachTradeTable(QTableView* table);
    void disruptTradeTable();

    void showTradeTable();
    virtual QList<Trade *> getAllTrades() const=0;
    virtual QStringList getValSymbols()const=0;
    virtual QStringList getValNames()const=0;
    virtual Stock* getTradeStocks()=0;
    virtual Trade* getTrade(const QString& stockName)=0;

signals:
    
public slots:
    void acceptBuyTradeValues(Trade* tmpTrade);

protected:
    void init();

private:
    void setupModel(int row, Trade *trade);
    QTableView* tradeTable;             //don't delete
    QStandardItemModel* model;          //model for the trade table
};

#endif // TRADEVIEW_H
